export interface User {
  _id: string
  username: string
  email: string
  role: 'user' | 'admin'
  profile?: {
    name?: string
    phone?: string
    address?: string
  }
  createdAt: string
}

export interface Product {
  _id: string
  name: string
  description: string
  price: number
  stock: number
  category: string
  images: string[]
  specifications?: Record<string, string>
  status: 'active' | 'inactive' | 'deleted'
  discount: number
  createdAt: string
  updatedAt: string
}

export interface CartItem {
  product: Product
  quantity: number
}

export interface Order {
  _id: string
  user: User
  items: {
    product: Product
    quantity: number
    price: number
  }[]
  totalAmount: number
  status: 'pending' | 'paid' | 'shipped' | 'delivered' | 'cancelled'
  shippingAddress: {
    name: string
    phone: string
    address: string
    city: string
    postalCode: string
  }
  paymentMethod: string
  paymentStatus: 'pending' | 'completed' | 'failed'
  createdAt: string
  updatedAt: string
}

export interface Coupon {
  _id: string
  code: string
  type: 'percentage' | 'fixed'
  value: number
  minPurchase?: number
  startDate: string
  endDate: string
  status: 'active' | 'inactive'
  usageLimit?: number
  usedCount: number
}

export interface Promotion {
  _id: string
  title: string
  description: string
  type: 'discount' | 'gift' | 'bundle'
  value: number
  products: Product[]
  startDate: string
  endDate: string
  status: 'active' | 'inactive'
} 